package chapter04

/**
 * @author: 余辉
 * @blog: https://blog.csdn.net/silentwolfyh
 *        descriptions:
 *        date: 2024 - 09 - 02 11:02 上午
 */
class SeqRdd(val c: Seq[String]) extends Rdd {
  override val iter = compute()
  override var dep: List[Rdd] = Nil

  override def compute(): Iterator[String] = {
    c.iterator
  }

  override def map(f: String => String): MapRdd = {
    new MapRdd(iter => iter.map(f), List(this))
  }

  override def foreach(f: String => Unit): Unit = iter.foreach(f)
}